Ext.namespace("Maint.Show66");

Maint.Show66.showInfo = function (){
	/* basic info */
    this.txtWoNum = new Ext.form.TextField({fieldLabel: '工单流水号',readOnly: true,width: 160 });
    this.txtCreateBy = new Ext.form.TextField({fieldLabel: '派单人',readOnly: true,width: 160 });
    this.txtContact= new Ext.form.TextField({fieldLabel: '联系方式',readOnly: true,width: 160 });
    this.txtCreateDep = new Ext.form.TextField({fieldLabel: '部门名称',readOnly: true,width: 160 });
    this.txtCreateTime = new Ext.form.DateField({fieldLabel: '派单时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtTopic = new Ext.form.TextArea({fieldLabel: '工单主题',readOnly: true,width: 460,height: 40 });
    this.txtReplyLimit = new Ext.form.TextField({fieldLabel: '回复时限',readOnly: true,width: 160 });
    /* expand info */
    this.txtTaskType = new Ext.form.TextField({fieldLabel: '任务类型',readOnly: true,width: 160 });   
    this.txtRequestLevel = new Ext.form.TextField({fieldLabel: '请求级别',readOnly: true,width: 160 });
    this.txtTaskCon = new Ext.form.TextArea({fieldLabel: '任务内容',readOnly: true,width: 460 });
    this.txtNote = new Ext.form.TextField({fieldLabel: '备注',readOnly: true,width: 460 });
    this.txtPigeonholeTime = new Ext.form.TextField({fieldLabel: '归档时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtPigeonholeNotion = new Ext.form.TextField({fieldLabel: '归档意见',readOnly: true,width: 460 });
    
    this.colseButton = new Ext.Button({
		text:"关闭",
		handler:function(){
			this.hide();
		},
		scope:this
	});

	this.basicPanel = new Ext.form.FormPanel({
		title:'工单基本信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtWoNum]},
			       {layout: 'form',items: [this.txtCreateBy]},
			       {layout: 'form',items: [this.txtContact]},
			       {layout:'form',items:[this.txtCreateDep]},
			       {colspan: 2,layout:'form',items:[this.txtTopic]},
			       {layout:'form',items:[this.txtCreateTime]},
   			       {layout: 'form',items: [this.txtReplyLimit]}
		]
	});

	this.expandPanel = new Ext.form.FormPanel({
		title:'工单扩展信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtTaskType]},
			       {layout: 'form',items: [this.txtRequestLevel]},
			       {colspan: 2,layout: 'form',items: [this.txtTaskCon]},
			       {colspan: 2,layout: 'form',items: [this.txtNote]},
			       {colspan: 2,layout: 'form',items: [this.txtPigeonholeNotion]},
			       {layout: 'form',items: [this.txtPigeonholeTime]}
		]
	});  
  
	this.mainPanel= new Ext.Panel({
		//height: bodyHeight-70,
		autoScroll: true,
		items: [this.basicPanel, this.expandPanel]
	}); 
	
	Maint.Show66.showInfo.superclass.constructor.call(this,{
		width:680,
		//height:bodyHeight,
		modal:true,
		autoScroll:false,
		closeAction:'hide',
		buttonAlign:'right',
		buttons:[this.colseButton],
		items:[this.mainPanel],
		listeners:{
		}
	});
};


Ext.extend(Maint.Show66.showInfo, Ext.Window, {
	initDetail:function(data){
		this.maintId = data.MAINT_ID;
	    this.txtWoNum.setValue(data.WO_NUM);
	    this.txtCreateBy.setValue(data.CREATE_BY);
	    this.txtContact.setValue(data.CONTACT);
	    this.txtCreateDep.setValue(data.CREATE_DEP);
	    this.txtCreateTime.setValue(data.CREATE_TIME);
	    this.txtReplyLimit.setValue(data.REPLY_LIMIT);
	    this.txtTopic.setValue(data.TOPIC);
	    this.txtTaskType.setValue(data.TASK_TYPE);
	    this.txtRequestLevel.setValue(data.REQUEST_LEVEL);
	    this.txtTaskCon.setValue(data.TASK_CON);
	    this.txtNote.setValue(data.NOTE);
	    this.txtPigeonholeTime.setValue(data.PIGEONHOLE_TIME);
	    this.txtPigeonholeNotion.setValue(data.PIGEONHOLE_NOTION);
	}
});